# -*- coding: utf-8 -*-
# @Time    : 2021/10/23 15:09
# @Author  : super

import socket

if __name__ == '__main__':
	# 建立链接
	tcp_socket_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	tcp_socket_client.connect(("192.168.31.9", 9090))

	# 发送数据
	send_data = "你好,我是xxx".encode("gbk")
	tcp_socket_client.send(send_data)

	#接收数据
	recv_data = tcp_socket_client.recv(1024)
	print(recv_data.decode("gbk"))

	# 关闭链接
	tcp_socket_client.close()